<?php

/**
 * Subclass for representing an opposite (with a score!)
 *
 * 
 *
 * @package lib.model
 */ 
class Opposite extends User
{
	protected $oppositeness;
	protected $compared_with;
	protected $type = OppositePeer::TYPE_NORMAL;
	
	public function setOppositePercentage($oppositeness=0){
		$this->oppositeness = $oppositeness;
	}
	
	public function getOppositePercentage(){
		return $this->oppositeness;
	}
	
	public function setType($type){
		if(in_array($type,OppositePeer::getOppositeTypes())){
			$this->type= $type;
		}
	}
	
	public function getType(){
		return $this->type;
	}
	
	public function setComparedWith($compared_with){
		$this->compared_with = $compared_with;
	}
	
	public function getComparedWith(){
		return $this->compared_with;
	}
	
	public function toJSONArray(){
		$props = parent::toArray(BasePeer::TYPE_FIELDNAME);
		$props['opposite_percentage'] = $this->getOppositePercentage();
		$props['compared_with'] = $this->getComparedWith();
		return $props; 
	}
	
}
